-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize matching zones to a given address #15275
Conversation
Bunnyshell Preview Environment deletedAvailable commands:
|
c77771e
to
6d55f85
Compare
6d55f85
to
5a3923a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it's a WIP, I'm just passing by 😅
src/Sylius/Bundle/AddressingBundle/Repository/ZoneRepository.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AddressingBundle/Repository/ZoneRepository.php
Outdated
Show resolved
Hide resolved
src/Sylius/Component/Addressing/spec/Matcher/ZoneMatcherSpec.php
Outdated
Show resolved
Hide resolved
d942eb3
to
66a1b99
Compare
66a1b99
to
7e975d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how to make it working without the sqlite database file :|. If anyone has an idea – I encourage to share or directly contribute. Otherwise let's merge it and wait for new test apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fabef59
to
2a47288
Compare
2a47288
to
89a5e8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Request changes
is mostly for
--- $query
+++ $queryBuilder`
which I just noticed. (I didn't mark them all)
P.S. Sorry for the "waves" reviews, I hope next one be the last one.
@@ -142,7 +143,7 @@ private function addResourcesSection(ArrayNodeDefinition $node): void | |||
->scalarNode('model')->defaultValue(Zone::class)->cannotBeEmpty()->end() | |||
->scalarNode('interface')->defaultValue(ZoneInterface::class)->cannotBeEmpty()->end() | |||
->scalarNode('controller')->defaultValue(ResourceController::class)->cannotBeEmpty()->end() | |||
->scalarNode('repository')->cannotBeEmpty()->end() | |||
->scalarNode('repository')->defaultValue(ZoneRepository::class)->cannotBeEmpty()->end() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not true for 1.12, every instance that you've found was introduced in 1.13.
I still don't know why it was done this way and how it even work, but custom repositories are not specified for Configuration for any of the bundle
src/Sylius/Bundle/AddressingBundle/Repository/ZoneRepository.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AddressingBundle/Repository/ZoneRepository.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AddressingBundle/Repository/ZoneRepository.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AddressingBundle/Repository/ZoneRepository.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AddressingBundle/Repository/ZoneRepository.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AddressingBundle/Repository/ZoneRepository.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AddressingBundle/Repository/ZoneRepository.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AddressingBundle/Repository/ZoneRepository.php
Outdated
Show resolved
Hide resolved
Thanks, Jacob! 🎉 |
/** | ||
* @implements ZoneRepositoryInterface<ZoneInterface> | ||
*/ | ||
class ZoneRepository extends EntityRepository implements ZoneRepositoryInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact that a new repository for an existing resource has shown up should be noted in the upgrade file. If someone has already created a custom one prior, the matcher will just fail.
]; | ||
|
||
public function __construct(private RepositoryInterface $zoneRepository) | ||
public function __construct(private ZoneRepositoryInterface $zoneRepository) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also be noted in the upgrade file
This PR was merged into the 1.13 branch. Discussion ---------- | Q | A | |-----------------|--------------------------------------------------------------| | Branch? | 1.13 <!-- see the comment below --> | | Bug fix? | yes | | New feature? | no | | BC breaks? | not anymore | | Related tickets | #15275 (comment) | | License | MIT | Commits ------- [Upgrade] Note ZoneRepository addition and ZoneMatcher constructor changes [Addressing] Support BC for ZoneMatcher [ECS] Apply ecs fixes
This PR was merged into the 1.13 branch. Discussion ---------- | Q | A | |-----------------|--------------------------------------------------------------| | Branch? | 1.13 <!-- see the comment below --> | | Bug fix? | yes | | New feature? | no | | BC breaks? | not anymore | | Related tickets | Sylius/Sylius#15275 (comment) | | License | MIT | Commits ------- [Upgrade] Note ZoneRepository addition and ZoneMatcher constructor changes [Addressing] Support BC for ZoneMatcher [ECS] Apply ecs fixes
Test data:
~1000 zones <-> zone members 1:1
~20 zones created with up to 7 level of nesting (zone in the zone in the zone...)
Before:
After: